package com.chixing.day05_oop.static_demo;

public class Student {
    //类加载：只加载一次到JVM
    //在类加载的时候，就已经运行了
    public static String unviersityName = "苏州大学";//类变量
    static {
        System.out.println("static 代码块");
    }

    //先创建对象，对象初始化的时候才有
    public int stuNo;//实例变量
    public String stuName;//实例变量

    public Student(){
        System.out.println("student 构造函数");
    }

    //对象名.方法名
    public void study(){
        this.stuNo = 10;
        this.stuName = "三分线";
        unviersityName = "";
    }
    //类名.方法名
    public static void fun(){
        unviersityName = "";
        //stuNo = 101;//error
    }

}
